import request from '@/until/request'
import Vue from 'vue';

// 用户列表
export const userList = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}user/list`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 新增用户
export const userAdd = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}user/add`,
    method: 'post',
    data: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改用户
export const userUpdate = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}user/update`,
    method: 'post',
    data: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 部门列表
export const departmentList = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}department/list`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}


// 新增部门
export const departmentAdd = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}department/add`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 删除部门
export const departmentDelete = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}department/delete`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改部门
export const departmentUpdate = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}department/update`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 删除
export const userDelete = (params) => {
  return request({
    url: `${Vue.prototype.$configURL}user/delete`,
    method: 'get',
    params: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
